/*
 * @Author: C.
 * @Date: 2023-03-31 09:59:54
 */
import { defHttp } from '/@/utils/http/axios';
import { getMenuListResultModel } from '../../sys/model/menuModel';

enum Api {
  GetMenuList = '/menu_permission/list',
  SaveMenu = '/menu_permission/save',
  DeleteMenu = '/menu_permission/delete',
  GetUserMenu = '/menu_permission/myself',
  BatchAddMenu = '/menu_permission/batch_add',
}

/**
 * @description: Get user menu based on id
 */

export const getMenuList = () => {
  return defHttp.post({ url: Api.GetMenuList });
};
export const saveMenu = (params) => {
  return defHttp.post({ url: Api.SaveMenu, params });
};

export const deleteMenu = (params) => {
  return defHttp.post({ url: Api.DeleteMenu, params });
};
export const getUserMenu = () => {
  return defHttp.get<getMenuListResultModel>({ url: Api.GetUserMenu });
};
export const batchAddMenu = (params: any) => {
  return defHttp.post({ url: Api.BatchAddMenu, params });
};
